<template>
  <div class="flexbox" :class="{ 'flexbox--v': dir === 'vertical' }">
    <component
      :is="runtime.placeholder"
      v-for="n in runtime.node.template.elements"
      :key="n.name"
      :template="n"
    />
  </div>
</template>

<style lang="scss" scoped>
.flexbox {
  display: flex;
  align-items: stretch;
  &--v {
    flex-direction: column;
  }
}
</style>

<script>
export default {
  name: 'FlexBox',
  inject: ['runtime'],
  props: {
    dir: {
      type: String,
      default: '',
    },
  },
};
</script>
